class CulturalHeritage::Model3D < ActiveRecord::Base
  validates :title, :presence => {:message => "El Titulo es requerido"}
  validates :model_url, :presence => {:message => "El id del video es requerido"}
  belongs_to :obj_user, :class_name => 'User',  :foreign_key => 'user'
  default_scope where("deleted = 0")
  validates_format_of :model_url, :with => URI::regexp(%w(http https))
  
  def display_name
    if !user.blank?
      return ''+title+' ('+obj_user.str_complete_name+')'
    else
      return ''+title+''
    end
  end
end
